/*
 * Created on 2005-3-15
 */
package com.hd123.rumba.exception;

import java.text.MessageFormat;

/**
 * @author caili
 */
public class BusinessException extends Exception {
  
  private static final long serialVersionUID = 300100L;
  
  public static BusinessException neverCallMe() {
    return new BusinessException("Never Call Me!");
  }
  
  public BusinessException(String s) {
    super(s);
  }
  
  public BusinessException(Exception e) {
    super(e);
  }

  public BusinessException(String pattern, Object... arguments) {
    super(MessageFormat.format(pattern, arguments));
  }
  
  public static BusinessException noPermission() {
    return new BusinessException("缺少必要的操作权限。");
  }
  
  public static BusinessException noPermission(String permCode) {
    return new BusinessException("缺少必要的操作权限\"" + permCode + "\"。");
  }
  
  public static BusinessException permissionChanged() {
    return new BusinessException("操作权限被修改，当前操作被取消。");
  }
}
